package com.googlecode.gwtbb.client.only.widget.basic;

import java.util.EventObject;

/**
 * @author Abraham Grief
 * @version $Id$
 * @since Apr 30, 2008
 */
public class AsyncFileUploadErrorEvent extends EventObject {
	private String errorMessage;
	private int index;

	public AsyncFileUploadErrorEvent() {
		super(null);
	}

	public AsyncFileUploadErrorEvent(Object source, String errorMessage) {
		super(source);
		this.errorMessage = errorMessage;
	}

	public AsyncFileUploadErrorEvent(Object source, String errorMessage, int index) {
		super(source);
		this.errorMessage = errorMessage;
		this.index = index;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	/**
	 * If this event belongs to a group of AsyncFileUploads,
	 * this indicates which AsyncFileUpload this event belongs to.
	 *
	 * @return 0-based index of which AsyncFileUpload had an error
	 */
	public int getIndex() {
		return index;
	}
}
